@model Category
@using (Ajax.BeginAjaxForm("Create", "Category", new jQueryAjaxOptions()
   {
       HttpMethod = "POST",
       AutoBlocking = true
   },
       new RouteValueDictionary(new { Area = "Publishing", id = Model != null ? Model.ID : 0 })))
{ 
    @Html.AntiForgeryToken() 
    <div style="padding: 10px;">
        <h3>
            <img style="float: left;" src="@Url.Content("~/Content/Images/Publishing/add_to_folder.png")"
            alt="" /><span style="float: left; margin-top: 8px;">@Html.Global("publishing", "AddCategoryTo")
                :
                @(Model != null ? (Model.Title.Equals("{site}", StringComparison.OrdinalIgnoreCase) ? "Root category" : Model.Title) : "Root category")</span></h3>
    </div>
    <table style="border: 1px solid #cccccc;" cellspacing="0" cellpadding="0px" class="d-field-table">
        <tr>
            <td style="vertical-align: top;">
                <h3 class="d-field-title">
                    <label for="Category_Title">
                        @Html.Global("RES_TITLE")
                    </label>
                </h3>
                <div class="d-field-description">
                   @Html.Global("publishing", "CategoryTitleTips")
                </div>
            </td>
            <td>
                @Ajax.Dna().TextBox("Category.Title").Width(250).GetHtml()
                <input name="Category.IsModerated" type="hidden" value="false" />
                <input name="Category.EnabledVersioning" type="hidden" value="false" />
            </td>
        </tr>
        <tr>
            <td valign="top">
                <h3 class="d-field-title">
                    @Html.Global("publishing", "AllowAnonymousePostComments")</h3>
                <div class="d-field-description">
                    @Html.Global("publishing", "AllowAnonymousePostCommentsTips")
                </div>
            </td>
            <td>
                @Ajax.DnaFor().CheckBox(m => m.AllowAnonymousPostComment, Url.Content("~/content/images/icon_accept_16.png"),
                   Url.Content("~/content/images/icon_block_16.png")).LocText("publishing", "Allow").GetHtml()
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="d-field-title">
                    @Html.Global("RES_IMAGE")</h3>
                <div class="d-field-description">
                    @Html.Global("publishing", "CategoryImageTips")
                </div>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            @Ajax.DnaFor().TextBox(m => m.ImageUrl).Width(300).GetHtml()
                        </td>
                        <td>
                            @Ajax.Dna().Button("btnBrowseLogo").LocText("RES_BROWSE").Click("_fileDlg(\"#Category_ImageUrl\");").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <h3 class="d-field-title">
                    <label for="Category_Description">
                        @Html.Global("RES_DESC")
                    </label>
                </h3>
                <div class="d-field-description">
                    @Html.Global("publishing", "CategoryDescriptTips")</div>
            </td>
            <td>
                @Ajax.DnaFor().TextArea(m => m.Description).Width(420).Height(208).Resizable().GetHtml()
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                @Ajax.Dna().Button("btnCreateNewCategory").Submit().ImageIcons(Url.Content("~/content/images/icon_save.gif")).LocText("RES_SAVE").GetHtml()
            </td>
        </tr>
    </table>
}
@Html.StartupScripts()
<script type="text/javascript">
    function _fileDlg(_el) {
      $dna.fileDlg("@Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name })", _el);
    }
</script>
